 function search(){

		document.indexForm.submit();
	 }
function trim(val)
 {
	return val.replace(/(\s*$)/g, "");
}

function checkInfo(){
	if(trim(document.getElementById("nav_name").value)=="")
	{
	  alert("导航名称不能为空！");
	  document.getElementById("nav_name").focus();
	  return false;
	}
	if(trim(document.getElementById("sort_order").value) == "")
	{
	  alert("排序不可以为空！");
	  document.getElementById("sort_order").focus();
	  return false;
	}
	/**
	* 检查是否为网址
	*
	* @param {}
	* str_url
	* @return;
	*/
	var temp = document.getElementById("link_url").value;
//	var strRegex ="^http://(www\.){0,1}.+\.(com|net|cn)$";

	var strRegex = "^((https|http|ftp|rtsp|mms)?://)"
	+ "?(([0-9a-z_!~*'().&amp;=+$%-]+: )?[0-9a-z_!~*'().&amp;=+$%-]+@)?" //ftp的user@
	+ "(([0-9]{1,3}\.){3}[0-9]{1,3}" // IP形式的URL- 199.194.52.184
	+ "|" // 允许IP和DOMAIN（域名）
	+ "([0-9a-z_!~*'()-]+\.)*" // 域名- www.
	+ "([0-9a-z][0-9a-z-]{0,61})?[0-9a-z]\." // 二级域名
	+ "[a-z]{2,6})" // first level domain- .com or .museum
	+ "(:[0-9]{1,4})?" // 端口- :80
	+ "((/?)|" // a slash isn't required if there is no file name
	+ "(/[0-9a-z_!~*'().;?:@&amp;=+$,%#-]+)+/?)$";


	var re = new RegExp(strRegex);
	if (trim(temp) == ""){
		alert("链接地址不能为空！");
		document.getElementById("link_url").focus();
		return false;
	}
	/*else if(!re.test(temp)){
			alert("请输入有效的链接地址！");
			document.getElementById("link_url").focus();
			return false;
	}	*/
   document.addForm.submit();

}

function delOneNews(val){
  if(window.confirm('确认删除吗?')){
 	  window.location.href='/doTradeReg.do?pkid='+val+'&bpm_id=5428';
  }
}

 function sortNews(val)
 {
    var elem=val.form.elements;
    var all_news_text='';
    for(i=0;i<elem.length;i++)
    {
        if(elem[i].type=="text" && elem[i].id!="navname")
        {
      	   all_news_text +=elem[i].id+','+elem[i].value+'|';
        }
    }
    //alert(all_news_text);
    document.indexForm.action='/doTradeReg.do';
    document.getElementById("sort").value=all_news_text;
    document.getElementById("bpm_id").value='2519';
    document.indexForm.submit();
 }